package com.lsmo.android.carfans.view.favorites;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.lsmo.android.carfans.R;
import com.lsmo.android.carfans.model.favorites.FavoritesThread;

public class FavoritesDistributorListItemLayout extends LinearLayout {
	
	private TextView mJNameText, mPhoneText, mType, mAddress;

	public FavoritesDistributorListItemLayout(Context context) {
		super(context);

		((LayoutInflater) context
				.getSystemService(Activity.LAYOUT_INFLATER_SERVICE)).inflate(
				R.layout.favorites_distributor_item_layout, this);
		
		mJNameText = (TextView) this
				.findViewById(R.id.favorites_distributor_listView_item_jName);
		mPhoneText = (TextView) this
				.findViewById(R.id.favorites_distributor_listView_item_phone);
		mType = (TextView) this
				.findViewById(R.id.favorites_distributor_listView_item_type);
		mAddress = (TextView) this
				.findViewById(R.id.favorites_distributor_listView_item_address);
	}

	public void updateView(FavoritesThread.CarDistributor fc) {
		this.mJNameText.setText(fc.getjName());
		this.mPhoneText.setText(fc.getPhone());
		this.mType.setText(fc.getType());
		this.mAddress.setText(fc.getAddress());
	}
}